﻿
@{
    ViewData["Title"] = "Index";
    Layout = "~/Areas/Console/Views/Shared/_Layout.cshtml";
}

@section head{

    <script src="~/js/CommonHelper.js"></script>
    <script type="text/javascript">
        var table;
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'form'], function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , table = layui.table;

            table.render({
                elem: '#table-datalist'
                , url: '/Console/SystemLog/GetListJson'
                , toolbar: false
                , limit: 20
                , title: '系统公告表'
                , cols: [[
                    { field: 'userName', title: '操作人', width: 150 }
                    , { field: 'cont', title: '操作方式' }
                    , { field: 'addtime', title: '操作时间', width: 160 }

                ]]
                , page: { layout: ['prev', 'page', 'next', 'refresh'] }
            });
            /* 监听提交 */
            form.on('submit(search)', function (data) {
                var params = {};
                params["keyword"] = $("#keyword").val();
                params["UserId"] = $("#UserId").val();
                table.reload('table-datalist', {
                    where: params,
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                });
                return false;
            });
            form.on('select(UserId)', function (data) {
                var params = {};
                params["keyword"] = $("#keyword").val();
                params["UserId"] = $("#UserId").val();
                table.reload('table-datalist', {
                    where: params,
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                });
                return false;
            });
        });
    </script>
}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                @*<div class="layui-card-header">条件查询</div>*@
                <div class="layui-card-body">
                    <form class="layui-form layui-form-pane" action="" lay-filter="component-form-group">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width:120px">操作员</label>
                                <div class="layui-input-inline">
                                    @Html.CusDropDownList("UserId", (SelectList)ViewBag.UserList, "请选择操作员", "", " lay-filter=\"UserId\" ")
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width:120px">关键字</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="keyword" name="keyword" value="" maxlength="25" placeholder="请填写需要查询的关键字" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button class="layui-btn  layui-btn-normal search-btn" lay-submit lay-filter="search" data-type="search"><i class="layui-icon layui-icon-search"></i>搜索</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="layui-card">
                @*<div class="layui-card-header">系统公告表</div>*@
                <div class="layui-card-body">
                    <table class="layui-hide" id="table-datalist" lay-filter="table-datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>
